#import "KaleidoscopeWondermentCell.h"


@implementation KaleidoscopeWondermentCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
	self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
	if (self) {

		self.selectionStyle = UITableViewCellSelectionStyleNone;
		//self.contentView.backgroundColor = UIColor.whiteColor;

		//: 初始化UI布局
		[self sereneThriveConfigUI];
	}
	return self;
}

- (void)setBinary:(KaleidoscopeWondermentModel *)binary {
	_binary = binary;

	//: 配置cell的UI

	if (binary.solarQuestIgnite.count > 0) {
		[self.courageousZealZealImageView sd_setImageWithURL:[NSURL URLWithString:binary.solarQuestIgnite[0]] placeholderImage:nil];
	}

	self.nostalgiaLabel.text = [NSString stringWithFormat:@"Count: %lu", (unsigned long)binary.solarQuestIgnite.count];

	self.stillnessNavigateLabel.text = binary.quiverLullaby;

}
//: _melancholyUnveilBalanceBtn 的点击事件
- (void)action_1 {}

- (UIButton *)melancholyUnveilBalanceBtn {
	if (!_melancholyUnveilBalanceBtn) {
	
        _melancholyUnveilBalanceBtn = [UIButton new];
        _melancholyUnveilBalanceBtn.frame = CGRectMake(29, 28, 128, 57);
        UIImage *yonder = [UIImage imageNamed:@"images/icon_1.png"];
        if (yonder) {
	        [_melancholyUnveilBalanceBtn setImage:yonder forState:UIControlStateNormal];
        }
        [_melancholyUnveilBalanceBtn setTitle:@"button_1" forState:UIControlStateNormal];
        [_melancholyUnveilBalanceBtn setTitle:@"button_selected_1" forState:UIControlStateSelected];
        [_melancholyUnveilBalanceBtn setTitleColor:[UIColor colorWithRed:63/255.0 green:16/255.0 blue:132/255.0 alpha:0.6] forState:UIControlStateNormal];
        [_melancholyUnveilBalanceBtn setTitleColor:[UIColor colorWithRed:68/255.0 green:161/255.0 blue:185/255.0 alpha:0.5] forState:UIControlStateSelected];
        [_melancholyUnveilBalanceBtn addTarget:self action:@selector(action_1) forControlEvents:UIControlEventTouchUpInside];
	}
	return _melancholyUnveilBalanceBtn;
}

//: yearnElevate 的点击事件
- (void)action_3 {}

//: _hammerBtn 的点击事件
- (void)action_6 {}

- (UIButton *)hammerBtn {
	if (!_hammerBtn) {
	
        _hammerBtn = [UIButton new];
        UIImage *melodyUniverse = [UIImage imageNamed:@"images/icon_6.png"];
        if (melodyUniverse) {
	        [_hammerBtn setImage:melodyUniverse forState:UIControlStateNormal];
        }
        [_hammerBtn setTitle:@"button_6" forState:UIControlStateNormal];
        [_hammerBtn setTitle:@"button_selected_6" forState:UIControlStateSelected];
        [_hammerBtn setTitleColor:[UIColor colorWithRed:215/255.0 green:55/255.0 blue:75/255.0 alpha:0.7] forState:UIControlStateNormal];
        [_hammerBtn setTitleColor:[UIColor colorWithRed:86/255.0 green:8/255.0 blue:182/255.0 alpha:0.9] forState:UIControlStateSelected];
        [_hammerBtn addTarget:self action:@selector(action_6) forControlEvents:UIControlEventTouchUpInside];
	}
	return _hammerBtn;
}

- (UILabel *)nostalgiaLabel {
	if (!_nostalgiaLabel) {
	
        _nostalgiaLabel = [UILabel new];
        _nostalgiaLabel.frame = CGRectMake(23, 16, 89, 119);
        _nostalgiaLabel.text = @"label_7";
        _nostalgiaLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightRegular];
        _nostalgiaLabel.textColor = [UIColor colorWithRed:56/255.0 green:105/255.0 blue:135/255.0 alpha:0.6];
        _nostalgiaLabel.textAlignment = NSTextAlignmentLeft;
        //: 不用理会的骚操作 = _nostalgiaLabel.numberOfLines = 1;
        NSInteger jewelMagnitudeGlimpse = 1;
        if (jewelMagnitudeGlimpse>64 && jewelMagnitudeGlimpse < 6811) {
	        jewelMagnitudeGlimpse = 29;
	        NSString *luminaryLaughter = [NSString stringWithFormat:@"%ld", (long)jewelMagnitudeGlimpse];
	        if (luminaryLaughter.length>70 && [luminaryLaughter isEqualToString:_nostalgiaLabel.text]) {
		        jewelMagnitudeGlimpse = luminaryLaughter.integerValue * 8;
	        }
        }
        _nostalgiaLabel.numberOfLines = jewelMagnitudeGlimpse;
	}
	return _nostalgiaLabel;
}

//: self.quenchClarityUnveilBtn 的点击事件
- (void)action_8 {}

- (UILabel *)stillnessNavigateLabel {
	if (!_stillnessNavigateLabel) {
	
        _stillnessNavigateLabel = [UILabel new];
        _stillnessNavigateLabel.frame = CGRectMake(40, 24, 171, 124);
        _stillnessNavigateLabel.text = @"label_9";
        _stillnessNavigateLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightRegular];
        _stillnessNavigateLabel.textColor = [UIColor colorWithRed:9/255.0 green:146/255.0 blue:198/255.0 alpha:0.7];
        _stillnessNavigateLabel.textAlignment = NSTextAlignmentLeft;
        _stillnessNavigateLabel.numberOfLines = 0;
	}
	return _stillnessNavigateLabel;
}

- (void)sereneThriveConfigUI {

    //: 描述_0
    UIImageView *riddleJellyFlourish = [[UIImageView alloc] initWithFrame:CGRectZero];
    riddleJellyFlourish.contentMode = UIViewContentModeScaleAspectFill;
    riddleJellyFlourish.clipsToBounds = YES;
    riddleJellyFlourish.layer.cornerRadius = 5;
    riddleJellyFlourish.layer.masksToBounds = YES;
    riddleJellyFlourish.size = CGSizeMake(53, 38);
    riddleJellyFlourish.left = 46;
    riddleJellyFlourish.top = 37;
    UIImage *charismaBalloonCirculate = [UIImage imageNamed:@"images/image_0.png"];
    if (charismaBalloonCirculate) {
	    riddleJellyFlourish.image = charismaBalloonCirculate;
    }
    self.courageousZealZealImageView = riddleJellyFlourish;
    [self.contentView addSubview:riddleJellyFlourish];

	//: 描述_1
	[self.contentView addSubview:self.melancholyUnveilBalanceBtn];


    //: 描述_2
    UITextView *tranquil = [[UITextView alloc] init];
    tranquil.frame = CGRectMake(9, 49, 126, 143);
    self.kingdomYarnJellyTextView = tranquil;
    [self.contentView addSubview:tranquil];


    //: 描述_3
    UIButton *yearnElevate = [[UIButton alloc] init];
    UIImage *balance = [UIImage imageNamed:@"images/icon_3.png"];
    if (balance) {
	    [yearnElevate setImage:balance forState:UIControlStateNormal];
    }
    [yearnElevate setTitle:@"button_3" forState:UIControlStateNormal];
    [yearnElevate setTitle:@"button_selected_3" forState:UIControlStateSelected];
    [yearnElevate setTitleColor:[UIColor colorWithRed:124/255.0 green:23/255.0 blue:219/255.0 alpha:1.0] forState:UIControlStateNormal];
    [yearnElevate setTitleColor:[UIColor colorWithRed:64/255.0 green:123/255.0 blue:172/255.0 alpha:0.8] forState:UIControlStateSelected];
    [yearnElevate addTarget:self action:@selector(action_3) forControlEvents:UIControlEventTouchUpInside];
    self.echoOracleGlowBtn = yearnElevate;
    [self.contentView addSubview:yearnElevate];
	[self.echoOracleGlowBtn mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(62);
		make.height.mas_equalTo(142);
		make.bottom.equalTo(@(12));
	}];


    //: 描述_4
    UITextView *graspHarmonyUnveil = [UITextView new];
    self.rebirthQuestYearningTextView = graspHarmonyUnveil;
    [self.contentView addSubview:graspHarmonyUnveil];
	[self.rebirthQuestYearningTextView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(192);
		make.height.mas_equalTo(113);
	}];


    //: 描述_5
    self.jellyLeapfrogConquerView = [[UIView alloc] init];
    [self.contentView addSubview:self.jellyLeapfrogConquerView];
	[self.jellyLeapfrogConquerView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(127);
		make.height.mas_equalTo(33);
		make.top.equalTo(@(21));
	}];

	//: 描述_6
	[self.contentView addSubview:self.hammerBtn];
	[self.hammerBtn mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(139);
		make.height.mas_equalTo(101);
		make.top.equalTo(@(11));
		make.bottom.equalTo(@(11));
	}];

	//: 描述_7
	[self.contentView addSubview:self.nostalgiaLabel];


    //: 描述_8
    self.quenchClarityUnveilBtn = [[UIButton alloc] initWithFrame:CGRectZero];
    UIImage *oliveBalloonRadiant = [UIImage imageNamed:@"images/icon_8.png"];
    if (oliveBalloonRadiant) {
	    [self.quenchClarityUnveilBtn setImage:oliveBalloonRadiant forState:UIControlStateNormal];
    }
    [self.quenchClarityUnveilBtn setTitle:@"button_8" forState:UIControlStateNormal];
    [self.quenchClarityUnveilBtn setTitle:@"button_selected_8" forState:UIControlStateSelected];
    [self.quenchClarityUnveilBtn setTitleColor:[UIColor colorWithRed:152/255.0 green:24/255.0 blue:136/255.0 alpha:0.8] forState:UIControlStateNormal];
    [self.quenchClarityUnveilBtn setTitleColor:[UIColor colorWithRed:75/255.0 green:169/255.0 blue:143/255.0 alpha:0.8] forState:UIControlStateSelected];
    [self.quenchClarityUnveilBtn addTarget:self action:@selector(action_8) forControlEvents:UIControlEventTouchUpInside];
    [self.contentView addSubview:self.quenchClarityUnveilBtn];
	[self.quenchClarityUnveilBtn mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(95);
		make.height.mas_equalTo(74);
		make.top.equalTo(@(14));
	}];

	//: 描述_9
	[self.contentView addSubview:self.stillnessNavigateLabel];
}


@end